<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
 
    <ui:composition> 

        <p:dialog id="UsersCreateDlg" widgetVar="UsersCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{MyBundle.CreateUsersTitle}" closeOnEscape="true">

            <h:form id="UsersCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" columnClasses="column">

                        <p:outputLabel value="#{MyBundle.CreateUsersLabel_user}" for="user" />
                        <p:inputText id="user" value="#{usersController.selected.user}" title="#{MyBundle.CreateUsersTitle_user}" required="true" requiredMessage="#{MyBundle.CreateUsersRequiredMessage_user}" size="10" maxlength="10"/>

                        <p:outputLabel value="#{MyBundle.CreateUsersLabel_password}" for="password" />
                        <p:inputText id="password" value="#{usersController.selected.password}" title="#{MyBundle.CreateUsersTitle_password}" required="true" requiredMessage="#{MyBundle.CreateUsersRequiredMessage_password}" size="10" maxlength="10"/>

                        <p:outputLabel value="#{MyBundle.CreateUsersLabel_email}" for="email" />
                        <p:inputText id="email" value="#{usersController.selected.email}" title="#{MyBundle.CreateUsersTitle_email}" required="true" requiredMessage="#{MyBundle.CreateUsersRequiredMessage_email}" size="50" maxlength="50" />

                        <p:outputLabel value="#{MyBundle.CreateUsersLabel_superadmin}" for="superadmin" />
                        <p:selectOneMenu id="superadmin" value="#{usersController.selected.superadmin}" required="true" requiredMessage="#{MyBundle.CreateUsersRequiredMessage_superadmin}"> 
                            <f:selectItem itemLabel="N" itemValue="N"  />             
                            <f:selectItem itemLabel="Y" itemValue="Y"  />             
                        </p:selectOneMenu>
                        <p:outputLabel value="#{MyBundle.CreateUsersLabel_status}" for="status" />
                        <p:selectOneMenu id="status" value="#{usersController.selected.status}" required="true" requiredMessage="#{MyBundle.CreateUsersRequiredMessage_status}">
                            <f:selectItem itemLabel="#{MyBundle.Active}" itemValue="Active"  />  
                            <f:selectItem itemLabel="#{MyBundle.Inactive}" itemValue="Inactive"  />  
                            <f:selectItem itemLabel="#{MyBundle.Connected}" itemValue="Connected"  />  
                        </p:selectOneMenu>
                        
                    </p:panelGrid>
                    <p:commandButton actionListener="#{usersController.saveNew}" value="#{MyBundle.Save}" update="display,:UsersListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,UsersCreateDialog);">
                        <p:confirm header="#{MyBundle.ConfirmationHeader}" message="#{MyBundle.ConfirmCreateMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>

                    <p:commandButton value="#{MyBundle.Cancel}" onclick="UsersCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
